Best Practices
Organizing Your Classesâ
- Create single-purpose classes that do one thing well
- Use clear, descriptive names for your classes
- Group related classes into logical categories in your stylesheet
- Document the purpose of each class in your stylesheet
Effective Class Combinationsâ
- Start with the base class that defines the main purpose of the element
- Add modifier classes to adjust appearance or behavior
- Keep combinations simple and meaningful
- Test combinations to ensure they work as expected
Performance Tipsâ
- Limit the number of classes per element to maintain clarity
- Use class combinations that make semantic sense
- Create class presets for commonly used combinations
- Regular cleanup of unused class combinations
Common Patternsâ
Content Typesâ
.note { /* Base styling for notes */ }
.warning { /* Warning-specific styling */ }
.tip { /* Tip-specific styling */ }
Visual Stylesâ
.highlighted { /* Highlight background */ }
.bordered { /* Add borders */ }
.rounded { /* Round corners */ }
Layoutâ
.centered { /* Center content */ }
.full-width { /* Full width container */ }
.condensed { /* Reduced spacing */ }
Example Combinationsâ
note warning
- Creates a warning notepanel highlighted rounded
- A highlighted panel with rounded cornerstable condensed bordered
- A compact table with borders